<?php
   class Home extends MY_Controller{
	   public function __construct(){
		   parent::__construct();
		   $this->load->model("model_home");
	   }
	   public function index(){	
		   $data['config']    = $this->config();
		   $data['intro'] 	  = $this->model_home->intro(2);
		   if($data['intro'] == NULL){
			   redirect(base_url());
		   }
		   $data['title'] 	  = "About Us";
		   $data['introduc']    = $this->model_index->intro();
		   $data['introduc']    = $this->model_index->intro();
		   $data['related']   = $this->model_home->related_intro(2);
		   $this->load->view("introduction/layout",$data);
	   }
	   public function booking(){	
		   $data['config']    = $this->config();
		   $data['title'] 	  = "Booking Conditions";
		   $data['introduc']    = $this->model_index->intro();
		   $data['result']   = $this->model_home->article(1);
		   $this->load->view("introduction/booking/layout",$data);
	   }
	   public function faq(){	
		   $data['config']    = $this->config();
		   $data['title'] 	  = "FAQs";
		   $data['introduc']    = $this->model_index->intro();
		   $data['result']   = $this->model_home->article(6);
		   $this->load->view("introduction/booking/layout",$data);
	   }
	   public function agents(){	
		   $data['config']    = $this->config();
		   $data['title'] 	  = "Agents";
		   $data['result']   = $this->model_home->article(7);
		   $data['introduc']    = $this->model_index->intro();
		   $this->load->view("introduction/booking/layout",$data);
	   }
	   public function view(){	
	   	   $id = (int)$this->uri->segment(3);
		   $data['config']    = $this->config();
		   $data['intro'] 	  = $this->model_home->intro($id);
		   if($data['intro'] == NULL){
			   redirect(base_url());
		   }
		   $data['title'] 	  = $data['intro']['in_name'];
		   $data['related']   = $this->model_home->related_intro($id);
		   $data['introduc']    = $this->model_index->intro();
		   $this->load->view("introduction/layout",$data);
	   }
   }